home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel0_89.lha / Feel / bin / ldn < prev    next >
Text File  |  1993-07-13  |  1KB  |  72 lines

  1. #!/bin/sh
  2.  
  3. # $Id: ldn,v 1.2 90/11/29 21:48:09 is Exp $
  4. # $Log:    ldn,v $
  5. # Revision 1.2  90/11/29  21:48:09  is
  6. # Changed brad_export to denton_export
  7. # Revision 1.1  90/11/29  21:47:24  is
  8. # Replacement ld script for Eulisp
  9.  
  10.  
  11. PATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH
  12.  
  13. # A replacement LD script.
  14. # Go through the arguements, and try and guess which are the ones
  15. # which are elvira modules. Construct the setup function
  16.  
  17. echo "Building init_elvira.c"
  18.  
  19. comline=""
  20. elviram=""
  21.  
  22. while [ $# -gt 0 ]
  23. do
  24.     case "$1" in
  25.     -*)
  26.         comline="$comline $1";;
  27.     *init_elvira.o)
  28.         ;;
  29.     *elvira.o)
  30.         comline="$comline init_elvira.o $1";;
  31.     *.c)
  32.         comline="$comline $1"
  33.         elviram="$elviram $1";;
  34.     *.o)
  35.         comline="$comline $1"
  36.         elviram="$elviram $1";;
  37.     *)
  38.         comline="$comline $1";;
  39.     esac
  40.     shift
  41. done
  42.  
  43. # When we get here, we should have a list of .o files belonging to 
  44. # Elvira modules
  45. #
  46. # Look for their startup routines
  47.  
  48. elviram=`echo $elviram | sed 's/\.c/.o/g'`
  49.  
  50. initnames=`nm -aeh $elviram | egrep 'Def\. Text *INIT_' | awk '{print $4}'`
  51.  
  52. cat ${LINK-/net/brad/denton_export/denton/You/NewYou/Feel/Src/el_linkins.c} > init_elvira.c
  53.  
  54. echo '
  55. void initialise_elvira_modules(LispObject *stacktop) 
  56. {
  57.   dp = nil;
  58.   dlp = nil;
  59. ' >> init_elvira.c
  60.  
  61. for i in $initnames
  62. do
  63. echo "    $i(stacktop);" >> init_elvira.c
  64. done
  65. echo "}" >> init_elvira.c
  66.  
  67. set -x
  68. cc -c $defines $ElviraHdrs init_elvira.c &&
  69. /bin/ld $comline
  70.